package day6;

import java.util.Scanner;

public class Main1 {
    /**
     * 疯狂的自我检索者
     * https://ac.nowcoder.com/acm/problem/205826
     */
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int sum = 0;
        for(int i = 0;i < n - m;i++) {
            int x = in.nextInt();
            sum += x;
        }

        // 最大就是用 5 分，最小就用 1 分
        double min = (sum + m * 1.0) * 1.0 / n;
        double max = (sum + m * 5.0) * 1.0 / n;
        System.out.printf("%.5f %.5f",min,max);
    }
}
